/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo916;


/**
 *
 * @author Administrator
 */
public class MethodSum {
    public static int sum(int a,int b){
        int s=0;
       for(int i=a;i<=b;i++){
           s=s+i;
       }
       return s;
    }
     
     public  int sum1(int a,int b){
        int s=0;
       for(int i=a;i<=b;i++){
           s=s+i;
       }
      return s;
      
    }

    public static void main(String args[]){
        int s1=sum(100,200);
        System.out.println(sum(200,300));
        //System.out.println(sum1(200,300));//error
        //int s2=sum1(400,500);//error
        MethodSum methodSum=new MethodSum(); 
        System.out.println(methodSum.sum1(400,500));
        
        
        
       
        
    }
    
    
}
